<template>
	<view class="msg-box">
		<view class="user-box">
			<view class="cus-title">{{cusType=='person' ? '个人客户基本信息' : '公司客户基本信息' }}</view>
			<view class="user-type">
				<view>
					<formItem v-for="(item,index) in list" :label="item.label" :key="index" v-model="form[item.model]" :disabled="disabled" titleType="dotted-title"></formItem>
				</view>				
			</view>
		</view>		
	</view>
</template>

<script>
	import formItem from '../../../../../components/lt-formItem/index.vue';
	import { personalCustomerDetails } from '@/api/cusList.js'
	export default{
		components:{
			formItem
		},
		props:{
			cusType:{type:String,default:'person'},
			orderId:{type:String,default:''},
			custType:{type:String,default:''},
			params:{type:Object,default:()=>{}}
		},
		async mounted(){
			console.log('custType',this.custType)
			let res = await personalCustomerDetails(this.params)
			if(this.custType === '个人'){
				this.list = this.userList
				this.form = res.rows.customerDetails
			} else {
				this.list = this.companyList
				this.form = res.rows.customerDetails
			}
		},
		data(){
			return{
				disabled:true,
				list:[],
				userList:[
					{
						label:'客户姓名',
						model:'customerName'
					},{
						label:'客户性质',
						model:'custType'
					},{
						label:'联系电话',
						model:'tel'
					},{
						label:'客户性别',
						model:'customerGender'
					},{
						label:'联系地址',
						model:'contactAddress'
					},{
						label:'证件类型',
						model:'cardType'
					},{
						label:'民族',
						model:'nation'
					},{
						label:'EMAIL',
						model:'email'
					},{
						label:'QQ',
						model:'qq'
					},{
						label:'微信',
						model:'wechat'
					},{
						label:'收入',
						model:'income'
					},{
						label:'职务',
						model:'post'
					},{
						label:'学历',
						model:'education'
					},{
						label:'婚姻',
						model:'marriage'
					},{
						label:'标签',
						model:'label'
					},{
						label:'备注',
						model:'remarks'
					},
				],
				companyList:[
					{
						label:'公司简称',
						model:'companyAbbreviation'
					},{
						label:'公司全称',
						model:'fullNameOfTheCompany'
					},{
						label:'联系人',
						model:'contacts'
					},{
						label:'联系电话',
						model:'contactNumber'
					},{
						label:'联系地址',
						model:'contactAddress'
					},{
						label:'公司性质',
						model:'natureOfTheCompany'
					},{
						label:'机构代码',
						model:'organizationCode'
					},{
						label:'公司电话',
						model:'companyOfficeNumber'
					},{
						label:'邮箱',
						model:'mailbox'
					},{
						label:'EMAIL',
						model:'email'
					},{
						label:'传真',
						model:'fax'
					},{
						label:'公司规模',
						model:'companySize'
					},{
						label:'标签',
						model:'label'
					},{
						label:'备注',
						model:'companyWebsite'
					}
				],
				form:{
					cusName:'测试名字'
				}
			}
		},
	}
</script>

<style lang="scss" scoped>
	.msg-box{
		padding: 24upx 24upx 24upx 24upx;
		.user-box{
			background-color: #fff;
			.cus-title{
				width: 100%;
				height: 80upx;
				// background-color: #f05;
				line-height: 80upx;
				padding-left: 24upx;
				border-bottom: 1upx solid #ddd;
			}
			.user-type{
				padding:0 12upx 48upx 12upx ;
			}
		}
	}
</style>
